package com.zyy.visitor.demo02;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/08/09 23:03
 */
public class Animal {
    public void execute() {
        System.out.println("Animal");
    }
}

class Dog extends Animal {
    @Override
    public void execute() {
        System.out.println("我是狗。。。");
    }
}

class Cat extends Animal {
    @Override
    public void execute() {
        System.out.println("我是猫。。。");
    }
}

class Client2 {
    public static void main(String[] args) {
        Animal a1 = new Dog();
        a1.execute();

        Animal a2 = new Cat();
        a2.execute();
    }
}
